Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optimise timeline feature #2180

Merged
merged 49 commits into from
May 6, 2024
Merged

Add optimise timeline feature #2180

merged 49 commits into from
May 6, 2024

Conversation

jonasongg
Copy link
Contributor

Fixes #2162
Part of #2157

Proposed commit message

Add optimise timeline feature

Currently, the ramps have a lot of empty space if the since and until
dates are specified far apart. 

Let's add a checkbox that can eliminate this empty space for each ramp.
This is especially useful if RepoSense is to be used to set up a report
of an individual's past OSS contributions.

Other information

@jonasongg jonasongg marked this pull request as draft April 1, 2024 07:32
@jonasongg jonasongg marked this pull request as ready for review April 6, 2024 14:09
@jonasongg jonasongg requested a review from a team April 6, 2024 14:10
Copy link
Contributor

@sopa301 sopa301 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just one nitpick:
The "state" of the button doesn't persist across refreshes. The "breakdown by file type" and "merge all groups" checkboxes retain their state when refreshed, so I think it would be good for the new checkbox to follow this behaviour as well!

@sopa301 sopa301 requested a review from a team April 15, 2024 03:05
@jonasongg
Copy link
Contributor Author

@sopa301 thank you and fixed!

Copy link
Member

@ckcherry23 ckcherry23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start @jonasongg! The optimised timelines are looking good and would definitely improve the usability of RepoSense!

While most of the changes you've made look good, there are some things left out and some design decisions to discuss too.

  1. [High priority] The chart zoom feature (selected using Ctrl/Cmd + click) does not work correctly when the timelines are optimised, i.e., the dates used for the zooming in are the same as the original dates instead of the optimised dates, which is misleading to the user.
  2. [Low priority] When I open the Commits Panel for an optimised chart, the chart shown at the top of the Commits Panel is not optimised.
  3. [Discuss] When the report is grouped by repos, the various authors under the repo may have different timelines. This discrepancy may make it difficult to compare when different teammates are contributing relatively. We may want to make the timeline duration consistent across a repo group (@damithc). However, when grouping by authors, this doesn't matter.
  4. [Discuss] We may want to think of a more intuitive name for "Optimise timeline", because it is not immediately clear what this feature does to end users. I would suggest something along the lines of "Condense charts".

frontend/src/components/c-ramp.vue Outdated Show resolved Hide resolved
@ckcherry23
Copy link
Member

Example repo before and after the optimise timelines option is activated.

Before:
Screenshot 2024-04-20 at 6 29 51 PM

After:
Screenshot 2024-04-20 at 6 29 35 PM

@ckcherry23 ckcherry23 requested a review from a team April 20, 2024 10:31
@damithc
Copy link
Collaborator

damithc commented Apr 20, 2024

Good inputs @ckcherry23

  • [Discuss] When the report is grouped by repos, the various authors under the repo may have different timelines. This discrepancy may make it difficult to compare when different teammates are contributing relatively. We may want to make the timeline duration consistent across a repo group (@damithc). However, when grouping by authors, this doesn't matter.

One option (probably easier too) is to take the stance that 'optimized' timelines isn't suitable for timeline comparisons. What do you all think?

  • [Discuss] We may want to think of a more intuitive name for "Optimise timeline", because it is not immediately clear what this feature does to end users. I would suggest something along the lines of "Condense charts".

'Trim'?

@jonasongg
Copy link
Contributor Author

@ckcherry23 @damithc thank you for your comments! will do the necessary changes asap.

as for when we are grouping by repos, it shouldn't be too difficult to make the timeline consistent across a group (i think we can just select the minimum and maximum commit date of the group instead of the user). i'm ok to implement either option!

i think "trim timeline" works!

Copy link
Member

@ckcherry23 ckcherry23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work @jonasongg! The ramps and the chart zoom work well now with the trim timelines feature!

However, fixing the zoom feature broke the optimization of the default ramp chart shown on the Commits Panel when "trim timelines" is enabled, sorry for the oversight. Maybe the best option is to pass the optimized timeline min/max dates conditionally along with filterSinceDate and filterUntilDate for this in lines 103 and 221 of c-summary-charts.vue?

The rest of the changes look good to me. As discussed, since we need other collaborators' help for adding Cypress tests, I think we can ignore that comment and ask for our second reviewer feedback now.

@ckcherry23 ckcherry23 requested a review from a team April 26, 2024 06:40
@jonasongg jonasongg requested a review from ckcherry23 April 30, 2024 10:39
Copy link
Member

@ckcherry23 ckcherry23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for this @jonasongg! This would be a super useful feature for setting up personal RepoSense reports!

@ckcherry23 ckcherry23 requested a review from a team May 1, 2024 05:52
Copy link
Member

@MarcusTXK MarcusTXK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested and works great. Definitely a very useful feature to have.

Regarding adding of other tests, such as to test it with the zoom feature in chartView_zoomFeature.cy.js, let's create an issue for these so we don't forget about it.

@jonasongg
Copy link
Contributor Author

@MarcusTXK the tests were actually added in this PR under optimiseTimeline.cy.js - should I change this?

@MarcusTXK
Copy link
Member

@jonasongg Ah OK, apologies I missed it. No worries, this works, let's leave it as it is then.

@ckcherry23 ckcherry23 merged commit 2457ebb into master May 6, 2024
15 checks passed
Copy link
Contributor

github-actions bot commented May 6, 2024

The following links are for previewing this pull request:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to only show active period a user was working on a repo
5 participants